<template>
	<view class="container">
		<view class="top">
			<view class="top-one" >
				<view class="head">
					<image :src="info.avatar" class="ren"></image>
				</view>
				<view class="jie">
					<view class="name">{{info.nickName}}<text>{{info.remark}}</text></view>
					<view class="tel">{{info.phonenumber}}<text>部门：{{info.dept.deptName}}</text></view>
				</view>
				<image src="../../static/images/jian.png" mode="" class="jian" @click="my()"></image>
			</view>
			<!-- <view class="top-one">
				<view class="head">
					<image src="../../static/images/ren.png" class="ren"></image>
				</view>
				<view class="jie com">
					<view class="name">用户名称</view>
					<view class="tel">点击授权</view>
				</view>
				<image src="../../static/images/jian.png" mode="" class="jian" @click="my()"></image>
			</view> -->
		</view>
		<view class="safe">
			<text>安全标准化</text>
			<view class="safes">
				<view class="safess" v-for="(item,index) in safes">
					<image :src="item.icon" mode=""></image>
					<view>{{item.text}}</view>
				</view>
			</view>
		</view>
		<view class="contact">
			<view class="con">
				<view class="cons" v-for="(item,index) in contact">
					<image :src="item.icon" mode=""></image>
					<view>{{item.text}}</view>
				</view>
			</view>
		</view>
	</view>	
</template>

<script>
	export default {
		data() {
			return {
				info:{},
				safes: [
					{
						icon: require('../../static/images/safe1.png'),
						text:'1、关于确定 公司安全省关于确定 公司安全省'
					},
                    {
						icon: require('../../static/images/safe2.png'),
						text:'2、关于安全 生产标准化...'
					},
				],
				contact: [
					{
						icon: require('../../static/images/contact1.png'),
						text:'客户联系'
					},
                    {
						icon: require('../../static/images/contact2.png'),
						text:'客户群'
					},
					{
						icon: require('../../static/images/contact3.png'),
						text:'客户朋友圈'
					},
					{
						icon: require('../../static/images/contact4.png'),
						text:'商品图册'
					},
					{
						icon: require('../../static/images/contact5.png'),
						text:'对外收款'
					},
					{
						icon: require('../../static/images/contact6.png'),
						text:'学习园地'
					},
				],
			}
		},
		onLoad() {
			this.deng();
			this.urser()
		},
		methods: {
			my(){
				uni.navigateTo({
				    url:'myCenter/myCenter'
				});
			},
			deng(){
				uni.request({
				     url: this.$url + 'login',
					 // header:{
					 //  'Authorization': 'Bearer ' + 'eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjcwMzFhZTUzLWQ3NDEtNDlhMS05MWU2LTdjNTA2MjNjYjJjYSJ9.rnpmqoCRKZZm7etVEKXVE7-2GIGqGDUPHQAjxNq__XFyW4g2otDTci8-v6NOS_g3BN4II7bkQfQeFVOWo5kqXA'
					 // },
				     method: 'POST',
					 data:{
						 isCodeVerify: false,
						  password:uni.getStorageSync('password'),
						  username:uni.getStorageSync('user')
					 },
				     success: (res) => {
				        console.log(res)
				     },
				     complete: () => {
				      
				     },
				     fail: (e) => {
				      console.log(e);
				     }
				    });
			},
			urser(){
				uni.request({
				     url: this.$url + 'getInfo',
				     method: 'GET',
					 header:{
					       'Authorization': 'Bearer ' + uni.getStorageSync("token")
					      },
				     success: (res) => {
				        console.log(res);
						if(res.data.code==200){
							this.info=res.data.data.userInfo
						}
						console.log(this.info)
				     },
				     complete: () => {
				      
				     },
				     fail: (e) => {
				      console.log(e);
				     }
				});
			}
		}
	}
</script>

<style lang="scss">
    .container{
		background-color: #F2F2F2;
		.top{
			background-color:#3472FD;
			
			.top-one{
				display:flex;
				justify-content:space-around;
				padding: 30rpx;
				align-items: center;
				padding-bottom: 90rpx;
				// flex-direction: column;
				.ren{
					width: 111rpx;
					height: 111rpx;
				}
				.jie{
					color: #fff;
					font-size:32rpx;
					line-height:40rpx;
					.name{
						line-height: 40rpx;
						font-size: 32rpx !important;
						text{
							display: inline-block;
							width:100rpx;
							line-height: 40rpx;
							font-size:32rpx !important;
							text-align: center;
							background-color: #fff;
							border-radius: 4px;
							color: #2571F6 !important;
							margin-left:30rpx;
						}
					}
					.tel{
						margin-top: 20rpx;
						font-size: 23rpx;
						text{
							margin-left: 15rpx;
						}
					}
				}
				.com{
					flex: 1;
					padding-left: 30rpx;
					.tel{
						border: 1px solid #fff;
						border-radius: 20rpx;
						width:130rpx;
						text-align: center;
						font-size:24rpx;
					}
				}
				.jian{
					width: 17rpx;
					height: 32rpx;
					vertical-align: middle;
				}
			}
		}
		.safe{
			background-color: #fff;
			border-top-left-radius: 60rpx;
			border-top-right-radius: 60rpx;
			margin-top:-70rpx;
			padding:30rpx;
			text{
				font-size:28rpx;
				padding-top:10rpx;
				font-weight: 600;
			}
			.safes{
				display: flex;				
				padding: 10rpx;
				margin-top:25rpx;
				.safess{
					width: 25%;
					text-align: center;
					margin-right:25rpx;
					image{
						display: inline-block;
						width: 90rpx;
						height: 90rpx;
						
					}
					view{
						// line-height:60rpx;
						font-size: 24rpx;
						display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow:hidden;
					}
				}
			}	
		}
		.contact{
			margin-top:20rpx;
			padding:45rpx 30rpx 30rpx;
			background-color:#fff;
			.con{
				display: flex;
				flex-wrap: wrap;
				// justify-content: space-between;
				.cons{
					width: 25%;
					text-align: center;
					margin-bottom: 30rpx;
					image{
						width: 90rpx;
						height: 90rpx;
					}
					view{
						font-size:24rpx;
						// line-height:60rpx
					}
				}
			}
		}
	}
</style>
